package com.bigfish.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import com.bigfish.dao.PmsCategoryDao;
import com.bigfish.dto.PmsCategoryDTO;
import com.bigfish.entity.PmsCategoryEntity;
import com.bigfish.service.PmsCategoryService;
import cn.hutool.core.util.StrUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 商品三级分类
 *
 * @author Wp 544065263@qq.com
 * @since 1.0.0 2025-09-06
 */
@Service
public class PmsCategoryServiceImpl extends CrudServiceImpl<PmsCategoryDao, PmsCategoryEntity, PmsCategoryDTO> implements PmsCategoryService {

    @Autowired
    private PmsCategoryDao pmsCategoryDao;

    @Override
    public QueryWrapper<PmsCategoryEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");

        QueryWrapper<PmsCategoryEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "id", id);

        return wrapper;
    }


    @Override
    public List<Map<String, Object>> selectCategory() {
        return pmsCategoryDao.selectCategory();
    }
}